<template>
  <div>
    <h1>{{ book.name }}</h1>
    <router-view />
  </div>
</template>

<script lang="ts" setup>
import {ref, onMounted, watch} from 'vue';
import { useRoute } from 'vue-router';
import axios from 'axios';
import request from "../utils/request";

const route = useRoute();
const book = ref({});



// onMounted(async () => {
//   try {
//     const  data  = await request.get(`/api/user/book/${route.params.bookId}`);
//     console.log(data);
//     book.value = data;
//   } catch (error) {
//     console.error('获取书本详情失败:', error);
//   }
// });
</script>
